// TODO: CODE REVIEW & CLEANUP!
//
// UnresponsiveSimulator.cs
//
// Implements HomeUX.Components.UnresponsiveSimulator.
//

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO.Ports;
using System.Text;
using HomeUX.Utilities;

namespace HomeUX.Components
{

/// <summary>
/// Simulates a serial port that accepts all input but which doesn't respond with any output.
/// </summary>
///
///
public class UnresponsiveSimulator : VirtualSerialPort
{
	///////////////////////////////////////////////////////////////////////////////////////////////
	// Private State
	//

	/// <summary>
	/// Holds the value of the <s>VirtualSerialPort.NewLine</s> property.
	/// </summary>
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	string m_newLine;

	///////////////////////////////////////////////////////////////////////////////////////////////
	// VirtualSerialPort Overrides
	//

    public override bool SupportsCharacterBasedTextMode
    {
        get
        {
            return true;
        }
    }

    public override bool SupportsLineBasedTextMode
    {
        get
        {
            return true;
        }
    }

    public override bool SupportsBinaryMode
    {
        get
        {
            return true;
        }
    }

	public override string NewLine
	{
		get
		{
            return m_newLine;
		}
        set
        {
			m_newLine = value;
        }
	}

    public override void Open()
    {
    }

	public override string ReadExisting()
	{
		return String.Empty;
	}

    public override void Write(byte[] buffer, int offset, int count)
    {
    }

	public override void WriteLine(string text)
	{
	}

    public override int BytesToRead
    {
        get
        {
            return 0;
        }
    }

    public override int Read(byte[] buffer, int offset, int count)
    {
        return 0;
    }

    public override void Write(string text)
    {
    }
}

}
